package com.name.givename.serviceimpl;


import com.name.givename.dao.UserBonusInfoEntityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by yangtianrui on 18/9/3.
 */
@Component
public class ScheduleTaskServiceImpl {

    @Autowired private UserBonusInfoEntityMapper bonusInfoEntityMapper;

    @Scheduled(cron="0 0 3 * * ?") //  每天凌晨三点更新数据（更新昨天未领取的红包）
    public void updateBonusTime () {
       bonusInfoEntityMapper.updateBonusTime(System.currentTimeMillis()/1000);
        System.out.println("执行");
    }
}
